import random


def game1():
    player_score, computer_score = 0, 0
    for i in range(3):
        player = input("请输入石头剪刀布：")
        # choice()的作用是从列表中随机选取一个元素
        computer = random.choice(['石头', '剪刀', '布'])
        print("电脑出的是：", computer)
        if player == computer:
            player_score += 1
            computer_score += 1
            print("平局，各得一分")
        elif (player == '石头' and computer == '剪刀') or (player == '剪刀' and computer == '布') or (
                player == '布' and computer == '石头'):
            player_score += 1
            print("玩家赢了，获得一分")
        else:
            computer_score += 1
            print("玩家得分%d分，电脑得分%d分" % (player_score, computer_score))
        if player_score == computer_score:
            print("平局")
        elif player_score > computer_score:
            print("玩家赢了")
        else:
            print("电脑赢了")


def game2(start, end):
    numbers = random.randint(start, end)
    while True:
        player = int(input("请输入一个数字"))
        if player == numbers:
            print("恭喜你猜对了")
            break
        elif player > numbers:
            print("猜大了")
        else:
            print("猜小了")
